﻿<%@ Register TagPrefix="ucCommon" TagName="Common" Src="../Common/Inc/Common.ascx" %>
<%@ Register TagPrefix="ucTop" TagName="Top" Src="../Common/Inc/Top.ascx" %>
<%@ Register TagPrefix="ucMenu" TagName="Menu" Src="../Common/Inc/Menu.ascx" %>
<%@ Register TagPrefix="ucTabTitle" TagName="TabTitle" Src="../Common/Inc/TabTitle.ascx" %>
<%@ Register TagPrefix="ucCopyright" TagName="Copyright" Src="../Common/Inc/Copyright.ascx" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Bby1010m.aspx.cs" Inherits="Updms.Bby.Bby1010m" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>▒ UPDMS [Bby1010m] ▒▒▒▒▒▒▒▒▒▒</title>
<ucCommon:Common id="Common" runat="server"></ucCommon:Common>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager runat="server" id="ScriptManager1" EnableScriptGlobalization="true"></asp:ScriptManager>

<table id="table_frame">
	<tr>
		<td id="top_area" colspan="2">
			<!-- Top 시작 -->
			<ucTop:Top id="Top" runat="server"></ucTop:Top>
			<!-- Top 끝 -->
		</td>
	</tr>
	<tr>
		<td id="menu_area">
			<!-- 메뉴 시작 -->
			<ucMenu:Menu id="Menu" runat="server"></ucMenu:Menu>
			<!-- 메뉴 끝 -->
		</td>
		<td id="contents_area">
			<!-- 제목 시작 -->
			<ucTabTitle:TabTitle id="TabTitle" TagPrefixs="Bby1010m" runat="server"></ucTabTitle:TabTitle>
			<!-- 제목 끝 -->
			<!-- AJAX 시작 -->
			<asp:UpdatePanel ID="UpdatePanel1" runat="server">
			<Triggers>
				<asp:PostBackTrigger ControlID="ibtn_excel"/>
			</Triggers>
			<ContentTemplate>
			<!-- 버튼 시작 -->
			<div class="button_area">
				<asp:linkbutton id="ibtn_excel" Text="엑셀" runat="server" CssClass="ibtn ibtn_excel" OnClick="ibtn_excel_Click"></asp:linkbutton>
				<asp:linkbutton id="ibtn_upload" Text="업로드" runat="server" CssClass="ibtn ibtn_upload" OnClientClick="goBbyUploadPage()"></asp:linkbutton>
				<asp:linkbutton id="ibtn_delete" Text="삭제" runat="server" CssClass="ibtn ibtn_delete" OnClientClick="return chkDelete()" OnClick="ibtn_delete_Click"></asp:linkbutton>
				<asp:linkbutton id="ibtn_save" Text="저장" runat="server" CssClass="ibtn ibtn_save" OnClientClick="return chkSave()" OnClick="ibtn_save_Click"></asp:linkbutton>
				<asp:linkbutton id="ibtn_search" Text="검색" runat="server" CssClass="ibtn ibtn_search" OnClientClick="return chkSearch(event)" OnClick="ibtn_search_Click"></asp:linkbutton>
			</div>
			<!-- 버튼 끝 -->			
			<!-- 검색 시작 -->
			<table class="table_search">
				<tr>
					<td class="lbl" width="11%"><asp:Literal id="ltr_search_lac_dt" Text="조회기간" runat="server" /></td>
					<td class="ctl" width="22%"><asp:textbox id="txt_search_lac_dt_from" runat="server" CssClass="ib_b_dt"></asp:textbox>&nbsp;<img src="../Common/Images/calendar.png" id="ci_search_lac_dt_from" class="ci_calendar" runat="server">&nbsp;~&nbsp;<asp:textbox id="txt_search_lac_dt_to" runat="server" CssClass="ib_b_dt"></asp:textbox>&nbsp;<img src="../Common/Images/calendar.png" id="ci_search_lac_dt_to" class="ci_calendar" runat="server"></td>
					<td class="lbl" width="11%"><asp:Literal id="ltr_search_baby_food_stuff" Text="주재료" runat="server" /></td>
					<td class="ctl" width="22%"><asp:textbox id="txt_search_baby_food_stuff" runat="server" Width="98%" CssClass="ib_b"></asp:textbox></td>
					<td class="ctl" width="33%"></td>
				</tr>
			</table>
			<!-- 검색 끝 -->
			<!-- 디테일 시작 -->
			<table class="table_detail">
				<tr>
					<td class="lbl" width="11%"><asp:Literal id="ltr_lac_dt" Text="수유일" runat="server" /></td>
					<td class="ctl" width="22%"><asp:textbox id="txt_lac_dt" runat="server" CssClass="ib_b_dt req" EnableViewState="False"></asp:textbox>&nbsp;<img src="../Common/Images/calendar.png" id="ci_lac_dt" class="ci_calendar" runat="server"></td>
					<td class="lbl" width="11%"><asp:Literal id="ltr_lac_num" Text="수유횟수" runat="server" /></td>
					<td class="ctl" width="22%"><asp:textbox id="txt_lac_num" runat="server" Width="98%" CssClass="ib_b req" EnableViewState="False"></asp:textbox></td>
					<td class="lbl" width="11%" rowspan="2"><asp:Literal id="ltr_remark" Text="비고" runat="server" /></td>
					<td class="ctl" width="22%" rowspan="2"><asp:textbox id="txt_remark" runat="server" Width="96%" TextMode="MultiLine" Rows="3" CssClass="tb_scroll" Height="37px" EnableViewState="False"></asp:textbox></td>
				</tr>
				<tr>
					<td class="lbl"><asp:Literal id="ltr_cc" Text="수유량" runat="server" /></td>
					<td class="ctl"><asp:textbox id="txt_cc" runat="server" Width="98%" CssClass="ib_b" EnableViewState="False"></asp:textbox></td>
					<td class="lbl"><asp:Literal id="ltr_real_cc" Text="실제수유량" runat="server" /></td>
					<td class="ctl"><asp:textbox id="txt_real_cc" runat="server" Width="98%" CssClass="ib_b req" EnableViewState="False"></asp:textbox></td>
				</tr>
				<tr>
					<td class="lbl"><asp:Literal id="ltr_baby_food" Text="이유식" runat="server" /></td>
					<td class="ctl"><asp:textbox id="txt_baby_food" runat="server" Width="98%" CssClass="ib_b" EnableViewState="False"></asp:textbox></td>
					<td class="lbl"><asp:Literal id="ltr_baby_food_stuff" Text="주재료" runat="server" /></td>
					<td class="ctl"><asp:textbox id="txt_baby_food_stuff" runat="server" Width="98%" CssClass="ib_b" EnableViewState="False"></asp:textbox></td>
					<td class="lbl"><asp:Literal id="ltr_poo_poo" Text="응가" runat="server" /></td>
					<td class="ctl">
						<asp:radiobuttonlist id="rbl_poo_poo" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" CssClass="rbl_flow">
							<asp:ListItem Value="Y" Selected="True">Y</asp:ListItem>
							<asp:ListItem Value="N">N</asp:ListItem>
						</asp:radiobuttonlist>
					</td>
				</tr>
			</table>
			<!-- 디테일1 끝 -->
			<!-- 리스트셋 시작 -->
			<table cellpadding="0" cellspacing="0" border="0" width="100%">
				<tr>
					<td>
						<!-- 검색어 시작 -->
						<div class="div_left">Keyword : <asp:label id="lbl_search_keyword" runat="server"></asp:label></div>
						<!-- 검색어 끝 -->
					</td>
				</tr>
				<tr>
					<td>
						<!-- 리스트 시작 -->
						<asp:GridView ID="GridView1" CssClass="table_gridview" GridLines="None" runat="server" AutoGenerateColumns="False" OnRowDataBound="GridView1_RowDataBound" OnRowCommand="GridView1_RowCommand" DataKeyNames="Seq,Remark">
							<Columns>
								<asp:TemplateField HeaderText="&lt;a href=&quot;javascript:void(0);&quot; onclick=&quot;checkBoxCheck('GridView1');&quot;&gt;S&lt;/a&gt;">
									<ItemTemplate>
										<input id="cb_check" class="cb" type="checkbox" onclick="reverseRow('GridView1', 0);" runat="server" />
									</ItemTemplate>
									<ItemStyle HorizontalAlign="Center" Width="2%" />
								</asp:TemplateField>
								<asp:BoundField HeaderText="번호" >
									<ItemStyle HorizontalAlign="Center" Width="4%" />
								</asp:BoundField>
								<asp:BoundField DataField="Seq" HeaderText="Seq(X)" Visible="false" />
								<asp:TemplateField HeaderText="수유일">
									<ItemStyle Width="12%" HorizontalAlign="Center" />
									<ItemTemplate>
										<asp:LinkButton ID="lbtn_rc" runat="server" Text='<%# Bind("Lac_Dt") %>'></asp:LinkButton>
									</ItemTemplate>
									<HeaderStyle CssClass="lbtn_rc balloon" />
								</asp:TemplateField>
								<asp:BoundField DataField="Lac_Num" HeaderText="수유횟수">
									<ItemStyle Width="6%" HorizontalAlign="Center" />
								</asp:BoundField>
								<asp:BoundField DataField="Cc" HeaderText="수유량">
									<ItemStyle Width="8%" HorizontalAlign="Right" />
								</asp:BoundField>
								<asp:BoundField DataField="Real_Cc" HeaderText="실제수유량">
									<ItemStyle Width="8%" HorizontalAlign="Right" />
								</asp:BoundField>
								<asp:BoundField DataField="Baby_Food" HeaderText="이유식">
									<ItemStyle Width="6%" HorizontalAlign="Center" />
								</asp:BoundField>
								<asp:BoundField DataField="Baby_Food_Stuff" HeaderText="주재료">
									<ItemStyle HorizontalAlign="Left" Width="48%" />
								</asp:BoundField>
								<asp:BoundField DataField="Poo_Poo" HeaderText="응가">
									<ItemStyle Width="6%" HorizontalAlign="Center" />
								</asp:BoundField>
								<asp:BoundField DataField="Remark" HeaderText="Remark(X)" Visible="false" />
							</Columns>
							<EmptyDataTemplate>
								<div id="no_data"></div>
							</EmptyDataTemplate>
						</asp:GridView>
						<!-- 리스트 끝 -->
					</td>
				</tr>
				<tr>
					<td>
						<!-- 페이징 시작 -->
						<div class="div_left">Result : <asp:label id="lbl_result_count" runat="server"></asp:label></div>
						<div class="div_right"><asp:label id="lbl_page" runat="server"></asp:label></div>
						<!-- 페이징 끝 -->
					</td>
				</tr>
			</table>
			<!-- 리스트셋 끝 -->
			<!-- 카피라이트 시작 -->
			<ucCopyright:Copyright id="Copyright" runat="server"></ucCopyright:Copyright>
			<!-- 카피라이트 끝 -->
			<!-- 히든값 시작 -->
			<div id="hdn_data">
				<asp:label id="lbl_pk" runat="server"></asp:label>
				<asp:Label id="lbl_search_flag" runat="server"></asp:Label>
				<input id="h_no" type="hidden" name="h_no" runat="server" />
			</div>
			<!-- 히든값 끝 -->
				<!-- CalendarExtender 시작 -->
				<act:CalendarExtender ID="ce_search_lac_dt_from"
					runat="server"
					TargetControlID="txt_search_lac_dt_from"
					Format="yyyy-MM-dd"
					PopupButtonID="ci_search_lac_dt_from"
					EnableViewState="False"
					BehaviorID="bi_search_lac_dt_from"
					CssClass="calendar">
				</act:CalendarExtender>
				<act:CalendarExtender ID="ce_search_lac_dt_to"
					runat="server"
					TargetControlID="txt_search_lac_dt_to"
					Format="yyyy-MM-dd"
					PopupButtonID="ci_search_lac_dt_to"
					EnableViewState="False"
					BehaviorID="bi_search_lac_dt_to"
					CssClass="calendar">
				</act:CalendarExtender>
				<act:CalendarExtender ID="ce_lac_dt"
					runat="server"
					TargetControlID="txt_lac_dt"
					Format="yyyy-MM-dd"
					PopupButtonID="ci_lac_dt"
					EnableViewState="False"
					BehaviorID="bi_lac_dt"
					CssClass="calendar">
				</act:CalendarExtender>
				<!-- CalendarExtender 끝 -->
				<!-- FilteredTextBoxExtender 시작 -->
				<act:FilteredTextBoxExtender ID="fte_lac_num"
					runat="server"
					TargetControlID="txt_lac_num"
					FilterType="Numbers">
				</act:FilteredTextBoxExtender>
				<act:FilteredTextBoxExtender ID="fte_cc"
					runat="server"
					TargetControlID="txt_cc"
					FilterType=" Numbers">
				</act:FilteredTextBoxExtender>
				<act:FilteredTextBoxExtender ID="fte_real_cc"
					runat="server"
					TargetControlID="txt_real_cc"
					FilterType=" Numbers">
				</act:FilteredTextBoxExtender>
				<act:FilteredTextBoxExtender ID="fte_baby_food"
					runat="server"
					TargetControlID="txt_baby_food"
					FilterType=" Numbers">
				</act:FilteredTextBoxExtender>
				<!-- FilteredTextBoxExtender 끝 -->
			</ContentTemplate>
			</asp:UpdatePanel>
			<!-- AJAX 끝 -->
		</td>
	</tr>
</table>

<asp:updateprogress AssociatedUpdatePanelID="UpdatePanel1" ID="updateProgress" runat="server">
	<progresstemplate>
		<div id="progressBackgroundFilter"></div>
		<div id="processMessage">
			<div id="processing"></div>
			<img src="../Common/Images/processing_img.gif" />
		</div>
	</progresstemplate>
</asp:updateprogress>

</form>
<script type="text/javascript" language="javascript" defer="defer">
	//검색
	function chkSearch(evt) {
		var e = (!evt) ? window.event : evt;
		var keyCode = e.keyCode;

		//날짜형식
		if (!isDateHyphen($F("txt_search_lac_dt_from"))) {
			msgBox.alert(getMsg(MSG_ERR_082), setFocus, "txt_search_lac_dt_from", keyCode); //잘못된 날짜형식입니다.(YYYY-MM-DD)
			return false;
		}
		//날짜형식
		if (!isDateHyphen($F("txt_search_lac_dt_to"))) {
			msgBox.alert(getMsg(MSG_ERR_082), setFocus, "txt_search_lac_dt_to", keyCode); //잘못된 날짜형식입니다.(YYYY-MM-DD)
			return false;
		}

		// 검색기간
		if (!isDateSeq($F("txt_search_lac_dt_from"), $F("txt_search_lac_dt_to"))) {
			msgBox.alert(getMsg(MSG_ERR_022), null, null, keyCode); //시작일자가 종료일자보다 늦을수 없습니다
			return false;
		}
		return true;
	}

	//엔터검색
	function enterSearchOnPage(evt) {
		var e = (!evt) ? window.event : evt;
		var keyCode = e.keyCode;

		if (keyCode == 13) {
			if (chkSearch(evt)) {
				__doPostBack('ibtn_search', '');
			}
		}
	}

	//저장
	function chkSave() {
		if ($F("txt_lac_dt").blank()) {
			msgBox.alert(getMsg(MSG_ERR_049), setFocus, "txt_lac_dt"); //수유일을 입력해 주세요
			return false;
		}

		if ($F("txt_lac_num").blank()) {
			msgBox.alert(getMsg(MSG_ERR_050), setFocus, "txt_lac_num"); //수유횟수를 입력해 주세요
			return false;
		}

		if ($F("txt_real_cc").blank()) {
			msgBox.alert(getMsg(MSG_ERR_052), setFocus, "txt_real_cc"); //실제수유량을 입력해 주세요
			return false;
		}

		var pk = $get("lbl_pk").innerHTML;
		var MSG_ID = (pk == "") ? MSG_CFM_000 : MSG_CFM_028; //저장/수정
		msgBox.confirm(getMsg(MSG_ID), doSave); //저장하시겠습니까?

		return false;
	}
	
	//삭제
	function chkDelete() {
		if(!isCheckedOnGridView("GridView1", 0)) {
			msgBox.alert(getMsg(MSG_ERR_053));	//삭제할 항목을 선택하세요
			return false;
		}
		msgBox.confirm(getMsg(MSG_CFM_001), doDelete);	//삭제하시겠습니까?
		return false;
	}

</script>
</body>
</html>